﻿#include "secondmenu.h"
#include "ui_secondmenu.h"

#include <QClipboard>

SecondMenu::SecondMenu(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SecondMenu)
{
    ui->setupUi(this);
}

SecondMenu::~SecondMenu()
{
    delete ui;
}



void SecondMenu::updateUi()
{
    QWidget *p = dynamic_cast<QWidget*>(parent());
    move(p->width() - 200, 120);
}

void SecondMenu::paintEvent(QPaintEvent *event)
{
    setAutoFillBackground(true);
    updateUi();
}

void SecondMenu::on_pushButton_2_clicked()
{
    emit showHistoryWidget();
}

void SecondMenu::on_pushButton_4_clicked()
{
    emit quitApplication();
}

void SecondMenu::on_pushButton_5_clicked()
{
    QClipboard * cb = QApplication::clipboard();
    // 此处填写的是github项目地址
    cb->setText("https://gitee.com/crazy_git/qt-safe-explore");
    // 界面提示
//    qDebug()<<"downlink have been writed clipboard";
    emit shareLink();
}

void SecondMenu::on_pushButton_clicked()
{
    emit showFeedbackDialog();
}

void SecondMenu::on_pushButton_3_clicked()
{
    emit showSettingWidget();
}

void SecondMenu::on_pushButton_6_clicked()
{
    emit showBookMarkWidget();
}
